import os, sys


sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # 添加导包路径

from fastapi import FastAPI, File, UploadFile


app = FastAPI()

# 接收reqeuest包发的请求
@app.post('/pdf')
async  def rec(file: UploadFile = File(...)):
    print(file.filename)
    with open(os.path.join('work',file.filename), 'wb+') as f:
        f.write(await file.read())
    return "ok"





